package com.zmzncs.lmtc.module.promotion.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zmzncs.lmtc.module.promotion.dao.MonthRuleFeeScaleMapper;
import com.zmzncs.lmtc.module.promotion.pojo.month_rule_fee_scale.MonthRuleFeeScale;
import com.zmzncs.lmtc.module.promotion.pojo.month_rule_fee_scale.MonthRuleFeeScaleDTO;
import com.zmzncs.lmtc.module.promotion.service.MonthRuleFeeScaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 任建波
 * @since 2020-08-12
 */
@Service
public class MonthRuleFeeScaleServiceImpl extends ServiceImpl<MonthRuleFeeScaleMapper, MonthRuleFeeScale> implements MonthRuleFeeScaleService {

    @Autowired
    MonthRuleFeeScaleMapper monthRuleFeeScaleMapper;

    /**
     * 根据停车场id查询支付规则
     */
    @Override
    public List<MonthRuleFeeScaleDTO> getMonthRuleFeeScaleByParkId(String parkId) {
        List<MonthRuleFeeScaleDTO> monthRuleParkDTOs = monthRuleFeeScaleMapper.getMonthRuleFeeScaleByParkId(parkId);
        return monthRuleParkDTOs;
    }

//    @Override
//    public void updateAllMWMonthServiceAddAmount(Integer serviceAddAmount) {
//        if (serviceAddAmount > 0){
//            BigDecimal decimal = new BigDecimal(serviceAddAmount);
//            monthRuleFeeScaleMapper.updateAllMWMonthServiceAddAmount(decimal);
//        }
//    }

}
